home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 May
/
EnigmA AMIGA RUN 18 (1997)(G.R. Edizioni)(IT)[!][issue 1997-05][EAR-CD II].iso
/
earcd
/
util
/
dir
/
managers.lha
/
Managers
/
Dir
/
Dir.gc
< prev
next >
Wrap
Text File
|
1997-01-15
|
7KB
|
298 lines
G4C
; This is a Full blown File Manager.
; I know it's difficult to follow specially since it consists
; of many GUIs which open-close on their own, but.. hey, it's
; a tough world out there..
; The main variable used is "lv_file", which is the name of the
; variable where both listviews will store the files selected.
; Get the full archive of Gui4Cli (Aminet:Dev/Gui/Gui4Cli.lha),
; read the guide and construct the file manager of your dreams!
WinBig 20 30 200 200 Devices
WinType 11110001
xOnLoad
setvar fm_mode 1
setgad Dir.gc 2 HIDE ; hide the gadgets of the
setgad Dir.gc 10 HIDE ; other half of the window
setgad Dir.gc 11 HIDE
setgad Dir.gc 12 HIDE
setgad Dir.gc 13 HIDE
setgad Dir.gc 14 HIDE
setgad Dir.gc 15 HIDE
setgad Dir.gc 16 HIDE
setgad Dir.gc 17 HIDE
guiopen Dir.gc
guiload :dir.cli
guiload :Dir.g ; load the helper guis
guiload :Dir.view ; auto view function
guiload :dir.prefs ; the default viewers
setvar lv_fmscreen "" ; start by opening on WB
setvar lvd_all none ; set our variables
setvar lv_dir1 ""
setvar lv_dir2 ""
setvar lv_current 1
rtn.option = ''
xonquit
guiquit Dir.g ; quit our other guis also
guiquit dir.view
guiquit Dir.g2
guiquit Dir.g3
guiquit dir.g4
guiquit dir.gv
guiquit dir.cli
guiquit dir.prot
guiquit dir.user
delvar lv_#? ; and delete *all* our variables
delvar mlv_#?
xOnOpen
SetGad dir.gc 20 OFF
xOnClose
SetGad dir.gc 20 ON
xAppIcon 0 0 :dir.gc DIR.gc lv_app OFF
GadID 20
GuiOpen dir.gc
GuiScreen dir.gc FRONT
if $lv_app > " "
gosub dir.gc appdir
endif
xAppWindow lv_app ; The FM is also an AppWindow
gosub dir.gc appdir ; going to the dir of the icon..
xroutine appdir
setvar lv_current 1
ifexists DIR $lv_app ; see what you have to do when you
lvdir dir.gc 1 #$lv_app ; don't have OR..
setwintitle dir.gc '$lv_app '
setvar lv_dir1 $lv_app
stop
endif
ifexists DOS $lv_app
lvdir dir.gc 1 #$lv_app
setwintitle dir.gc '$lv_app '
setvar lv_dir1 $lv_app
stop
endif
ifexists FILE $lv_app
extract lv_app PATH lv_app2
lvdir dir.gc 1 #$lv_app2
setwintitle dir.gc '$lv_app2 '
setvar lv_dir1 $lv_app2
extract lv_app FILE lv_app2
lvfind dir.gc 1 $lv_app2
stop
endif
xOnRMB
guiopen Dir.g ; This has the copy, delete etc functions
xOnJump lv_newscreen ; If the user jumps screens
setscreen Dir.g $lv_newscreen ; we have to make the other GUIs
setscreen Dir.g2 $lv_newscreen ; follow also..
setscreen Dir.g3 $lv_newscreen
setscreen Dir.g4 $lv_newscreen
setscreen Dir.gv $lv_newscreen
setscreen dir.cli $lv_newscreen
setscreen dir.user $lv_newscreen
setvar lv_fmscreen $lv_newscreen ; the load-when-needed guis need it.
;========================= The Directory ListViews ==================
; Note they both have Hooks which are used to store the current dir
; name to a variable and display it to the user.
;---------> the left side
xListView 0 0 185 0 "" lv_file "" 10 DIR
gadid 1
lvdirhook 1
GadFont topaz.font 8 000 ; CHANGE THIS TO THE FONT YOU LIKE!
;LVColors 2 1 3 2
guiopen Dir.g2
xLVDirHook 1
setvar lv_dir1 $$LV_DIR ; store the current directory name
setvar lv_current 1
setwintitle Dir.gc '$lv_dir1 ' ; show it in the wintitle
;----------> the right side
xListView 200 14 185 186 "" lv_file "" 10 DIR
gadid 2
lvdirhook 2
GadFont topaz.font 8 000 ; CHANGE THIS TO THE FONT YOU LIKE!
guiopen Dir.g2
xLVDirHook 2
setvar lv_dir2 $$LV_DIR ; store the current directory name
setvar lv_current 2
update Dir.gc 10 $lv_dir2 ; show it in xTextIn gadget below
xTextIn 200 0 185 14 "" lv_dir2 "" 140
gadid 10
GadFont topaz.font 8 000
LVDir Dir.gc 2 #$lv_dir2 ; you can change the dir from here
setvar lv_current 2
;======================== The Action buttons ==========================
;--------> for the left side (source)
xButton 185 0 15 15 P
LVDir Dir.gc 1 parent
setvar lv_dir1 $$LV_DIR
setwintitle Dir.gc '$lv_dir1 '
xButton 185 15 15 15 R
LVDir Dir.gc 1 Root
setvar lv_dir1 $$LV_DIR
setwintitle Dir.gc '$lv_dir1 '
xButton 185 30 15 15 D
LVDir Dir.gc 1 Disks
setvar lv_dir1 ""
setwintitle Dir.gc 'Devices'
xButton 185 45 15 15 A
LVDir Dir.gc 1 All
xButton 185 60 15 15 N
LVDir Dir.gc 1 None
xButton 185 155 15 15 R
lvdir Dir.gc 1 Refresh
xButton 185 170 15 15 < ; move list left
lvmove Dir.gc 1 -10
xButton 185 185 15 15 >
lvmove Dir.gc 1 10
;---------> for the right side (destination) give gadID so we set them on/off
xButton 385 0 15 15 P
GadID 11
LVDir Dir.gc 2 parent
setvar lv_dir2 $$LV_DIR
update Dir.gc 10 $lv_dir2
xButton 385 15 15 15 R
gadid 12
LVDir Dir.gc 2 Root
setvar lv_dir2 $$LV_DIR
update Dir.gc 10 $lv_dir2
xButton 385 30 15 15 D
gadid 13
LVDir Dir.gc 2 Disks
setvar lv_dir2 ""
update Dir.gc 10 ""
xButton 385 45 15 15 A
gadid 14
LVDir Dir.gc 2 All
xButton 385 60 15 15 N
gadid 15
LVDir Dir.gc 2 None
xButton 385 155 15 15 R
lvdir Dir.gc 2 Refresh
xButton 385 170 15 15 < ; move list left
GadID 16
lvmove Dir.gc 2 -10
xButton 385 185 15 15 > ; move list right
GadID 17
lvmove Dir.gc 2 10
;---------> open full file manager
xButton 185 90 15 15 >
gadid 21
if $fm_mode = 1
gosub Dir.gc OpenWindow
else
gosub Dir.gc CloseWindow
endif
;--------> button to switch left <-> right lvs
xButton 185 105 15 15 x
gadid 20
setvar lv_temp $lv_dir2 ; exchange the var names
setvar lv_dir2 $lv_dir1
setvar lv_dir1 $lv_temp
LVDir Dir.gc 1 #$lv_dir1 ; update the listviews
setwintitle Dir.gc '$lv_dir1 ' ; and their dir displays
LVDir Dir.gc 2 #$lv_dir2
update Dir.gc 10 $lv_dir2
delvar lv_temp
;--------> same directories
xButton 185 120 15 15 =
if $$LV_ID = 1
lvdir dir.gc 2 #$lv_dir1
lv_dir2 = $lv_dir1
update Dir.gc 10 $lv_dir2
else
lvdir dir.gc 1 #$lv_dir2
lv_dir1 = $lv_dir2
setwintitle Dir.gc '$lv_dir1 '
endif
;---------> ROUTINES
xRoutine OpenWindow ; Routine to enlarge the window
setvar fm_mode 2
setgad Dir.gc 2 SHOW
setgad Dir.gc 10 SHOW
setgad Dir.gc 11 SHOW
setgad Dir.gc 12 SHOW
setgad Dir.gc 13 SHOW
setgad Dir.gc 14 SHOW
setgad Dir.gc 15 SHOW
setgad Dir.gc 16 SHOW
setgad Dir.gc 17 SHOW
changearg Dir.gc 21 4 <
changegad Dir.gc 0 -1 -1 400 200 ""
redraw Dir.gc
update Dir.gc 10 $lv_dir2
xRoutine CloseWindow ; make it small again
setvar fm_mode 1
setgad Dir.gc 2 HIDE
setgad Dir.gc 10 HIDE
setgad Dir.gc 11 HIDE
setgad Dir.gc 12 HIDE
setgad Dir.gc 13 HIDE
setgad Dir.gc 14 HIDE
setgad Dir.gc 15 HIDE
setgad Dir.gc 16 HIDE
setgad Dir.gc 17 HIDE
changegad Dir.gc 0 -1 -1 200 200 ""
changearg Dir.gc 21 4 >
redraw Dir.gc
RESIZE_BIG 154 11 226 250 dir.gc